<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>资料管理</title>
    <link href="__STATIC__/css/swiper.min.css" rel="stylesheet">
    <link href="/html/layui/css/layui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="/html/css/base.css">
</head>

<script type="text/javascript">
    //全局变量
    var GV = {
        ROOT: "__ROOT__/",
        WEB_ROOT: "__WEB_ROOT__/",
        JS_ROOT: "static/js/",
        APP: '{$Request.module}'/*当前应用名*/
    };
</script>
<script src="__STATIC__/js/wind.js"></script>
<!-- HTML5 shim for IE8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<![endif]-->


<link href="/themes/admin_simpleboot3/public/assets/themes/{:cmf_get_admin_style()}/bootstrap.min.css" rel="stylesheet">
<link href="/themes/admin_simpleboot3/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!--[if lt IE 9]>
<script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<body>
<div class="activity" id="personHeight">
    <div class="title">
        <ul class="news-title">
            <li class="title-item active"><a href="javascript:;">个人信息修改</a></li>
            <!--<li class="title-item"><a href="javascript:;">车辆信息</a></li>-->
            <li class="title-item"><a href="javascript:;">密码修改</a></li>
        </ul>
        <a href="{:cmf_url('user/Index/logout')}" title="退出账户">
            <svg style="margin-left: 500px;margin-top: 5px" t="1575252806910" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1913" width="35" height="35" ><path d="M977.1 402.1c-8.9-36.3-21.6-70.8-38-103.6-16.5-32.7-36.9-63.4-61.2-91.8-24.3-28.5-51.7-54.3-81.6-76.9-15.7-11.3-32.7-15.6-50.9-12.8-18.3 2.9-33.1 11.8-44.5 26.8-11.4 15-15.7 31.7-12.9 50.2 2.9 18.5 11.8 33.5 26.9 44.8 45 32.8 79.5 73 103.5 120.7s35.9 99 35.9 153.8c0 47-8.9 91.3-26.9 133-17.8 41.6-42.3 78-73.5 108.9-31.2 30.9-67.6 55.5-109.4 73.7C602.6 847 558.1 856 510.8 856c-47.2 0-91.7-9.1-133.6-27.2-41.9-18.1-78-42.8-109.2-73.8-31.1-30.9-55.8-67.3-74-108.9-18.3-41.6-27.4-86-27.4-133 0-55.5 12.9-108.1 38.6-157.5 25.8-49.4 61.9-90.2 108.3-122.3 15.7-10.7 25.3-25.3 28.4-43.8 3.2-18.5-0.5-35.6-11.3-51.3-10.8-15-25.4-24.1-44-27.2-18.4-3.2-35.6 0.5-51.3 11.2-32.1 22.8-60.8 48.6-85.8 77.5s-46.5 60-64.4 93.4c-17.9 33.6-31.6 69.3-40.7 106.3-9.2 37.3-14 75.3-14 113.7 0 66.2 12.7 128.3 38 186.4 25.4 58 59.8 108.6 103 151.6 43.3 43.1 94 77.3 152.3 102.5 58.3 25.3 120.7 37.9 187.2 37.9 65.8 0 127.8-12.6 186.2-37.9 58.2-25.3 109.2-59.5 152.8-102.5 43.6-43.1 77.9-93.6 103-151.6 25-58 37.5-120.2 37.5-186.4 0.1-37.7-4.4-74.7-13.3-111zM515 542.8c17.5 0 32.6-6.2 45-18.6 12.5-12.4 18.7-27.4 18.7-44.9V95.9c0-17.4-6.2-32.6-18.7-45.4-12.5-12.7-27.5-19.2-45-19.2-18.3 0-33.6 6.4-46.1 19.2-12.5 12.7-18.7 27.9-18.7 45.4v383.3c0 17.4 6.2 32.4 18.7 44.9s27.8 18.7 46.1 18.7z" fill="#d81e06" p-id="1914"></path></svg>
        </a>
    </div>
    <div class="box-cont">
        <div class="act-forenotice">
            <!--个人信息-->
            <!--<form class="layui-form" action="{:url('portal/personal/save_user_info')}" method="post">-->
            <form class="layui-form" id="form">
                <div class="formLeft">
                    <div class="layui-form-item">
                        <label class="layui-form-label widthSty">用户姓名:<br></label>
                        <div class="layui-input-block">
                            {$user.user_nickname|default=''}
                            <!--<input type="text" name="title" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">-->
                        </div>
                    </div>
                    <div class="layui-form-item">
                    <label class="layui-form-label widthSty">身份证号:<br></label>
                    <div class="layui-input-block">
                        <!--{$user.more.idcard|default=''}-->
                        <input type="text" id="idcard" name="more[idcard]" value="{$user.more.idcard|default=''}" required  lay-verify="required" placeholder="请输入身份证号" autocomplete="off" class="layui-input">
                    </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">性别:</label>
                        <div class="layui-input-block">
                           {$sex[$user.sex]}
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label widthSty">出生日期:<br></label>
                        <div class="layui-input-block">
                            {$user.birthday!=0?$user.birthday|date="Y-m-d":''}
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">社区:</label>
                        <div class="layui-input-inline">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$user.communities.name}
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">籍贯:</label>
                        <div class="layui-input-block">
                            <input type="text" name="more[native]" value="{$more.native|default=''}"  placeholder="请输入籍贯" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">政治面貌:</label>
                        <div class="layui-input-block">
                            <select name="more[politic]" lay-verify="required">
                                <option value="{$more.politic|default=''}">{$more.politic|default=''}</option>
                                <option value="0">群众</option>
                                <option value="1">团员</option>
                                <option value="2">党员</option>
                            </select>
                        </div>
                    </div>
                    <!--<div class="layui-form-item">-->
                        <!--<label class="layui-form-label">固定电话:</label>-->
                        <!--<div class="layui-input-block">-->
                            <!--<input type="text" name="title" required  lay-verify="required" placeholder="请输入您的固定电话" autocomplete="off" class="layui-input">-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="layui-form-item">-->
                        <!--<label class="layui-form-label">移动电话:</label>-->
                        <!--<div class="layui-input-block">-->
                            <!--<input type="text" name="title" required  lay-verify="required" placeholder="请输入您的移动电话" autocomplete="off" class="layui-input">-->
                        <!--</div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">现住址:</label>
                        <div class="layui-input-block">
                            <input type="text" name="more[address]" value="{$more.address|default=''}"  placeholder="请输入您的现住址" autocomplete="off" class="layui-input">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">团体(选填):</label>
                        <div class="layui-input-block">
                            <select name="group" >
                                <option value="{$user.gorup|default=''}">{$user.groups.name|default='选择团体'}</option>
                                <foreach name="group" id="vo">

                                    <option value="{$vo.id}">{$vo.name}</option>
                                </foreach>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">工作单位:</label>
                        <div class="layui-input-block">
                            <input type="text" name="more[company]" value="{$more.company|default=''}"  placeholder="请输入你的工作单位" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <!--<div class="layui-form-item">-->
                        <!--<label class="layui-form-label">QQ:</label>-->
                        <!--<div class="layui-input-block">-->
                            <!--<input type="text" name="more[qq]" required  lay-verify="required" placeholder="请输入你的QQ" autocomplete="off" class="layui-input" value="{$more.qq|default=''}">-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="layui-form-item">-->
                        <!--<label class="layui-form-label">微信:</label>-->
                        <!--<div class="layui-input-block">-->
                            <!--<input type="text" name="more[weixin]" required  lay-verify="required" placeholder="请输入你的微信" autocomplete="off" class="layui-input" value="{$more.weixin|default=''}">-->
                        <!--</div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">职业:</label>
                        <div class="layui-input-block">
                            <select name="more[work]" >
                                <option value="{$more.work|default=''}">{$more.work|default=''}</option>
                                <option value="保密">保密</option>
                                <option value="金融">农村农业</option>
                                <option value="生产加工">生产加工</option>
                                <option value="制造">制造</option>
                                <option value="服务娱乐">服务娱乐</option>
                                <option value="政治">政治</option>
                                <option value="科研教育">科研教育</option>
                                <option value="管理">管理</option>
                                <option value="商业">商业</option>
                                <option value="其他">其他</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文化程度:</label>
                        <div class="layui-input-block">
                            <select name="more[educate]" >
                                <option value="{$more.educate|default=''}">{$more.educate|default=''}</option>
                                <option value="小学">小学</option>
                                <option value="初中">初中</option>
                                <option value="高中">高中</option>
                                <option value="大专">大专</option>
                                <option value="本科">本科</option>
                                <option value="硕士">硕士</option>
                                <option value="博士">博士</option>
                            </select>
                        </div>
                    </div>
                    <!--<div class="layui-form-item layui-form-text">-->
                        <!--<label class="layui-form-label">工作学习经历:</label>-->
                        <!--<div class="layui-input-block">-->
                            <!--<textarea name="more[experience]" placeholder="请输入您的工作学习经历" class="layui-textarea">{$more.experience|default=''}</textarea>-->
                        <!--</div>-->
                    <!--</div>-->
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">爱好及特长:</label>
                        <div class="layui-input-block">
                            <textarea name="more[hobby]" placeholder="请输入您的爱好及特长" class="layui-textarea">{$more.hobby|default=''}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">补充信息:</label>
                        <div class="layui-input-block">
                            <textarea name="more[extra]" placeholder="请输入补充信息" class="layui-textarea">{$more.extra|default=''}</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label"> 志愿服务岗位：（任选1--2项）</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title=" 消防志愿者服务支队管理员">
                            <input type="checkbox" name="like1[read]" lay-skin="primary" title=" 消防志愿者服务支队工作人员">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title=" 学校消防志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="   社区消防志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="  消防艺术团志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="   消防志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="  企业单位消防志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="  机关团体事业单位消防志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="  火灾隐患预防整改消防志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="    消防安全救助志愿者">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="  山海天消防应急志愿者服务中队">
                            <input type="checkbox" name="like1[game]" lay-skin="primary" title="   应急救援者支队">

                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">所属大队:</label>
                        <div class="layui-input-block">
                            <select name="city" lay-verify="required">
                                <option value=""></option>
                                <option value="0">消防志愿者社区服务大队</option>

                            </select>
                        </div>
                        <label class="layui-form-label">所属中队:</label>
                        <div class="layui-input-block">
                            <select name="city" lay-verify="required">
                                <option value=""></option>
                                <option value="0">一中队</option>

                            </select>
                        </div>
                    </div>

                    <input type="hidden" name="avatar" id="img" value="{$user.avatar}">

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn btnWidth " lay-submit lay-filter="per_data">提交个人信息</button>
                            <!--<button type="reset" class="layui-btn btnWidth ordBtn">下载个人档案</button>-->
                            <a href="{:url('portal/volunt/save_word',['user_id'=>$user.id])}" target="_blank" class="layui-btn btnWidth ordBtn">下载个人档案</a>
                        </div>
                    </div>
                </div>
                <div class="formRight">

                    <a href="javascript:;" class="" id="test1">
                        <img src="{$user.avatar}" id="pic"
                             width="135" style="cursor: pointer"/>
                        (点击更换头像)
                    </a>
                </div>
                <div style="clear: both;"></div>
            </form>
        </div>

        <div class="act-forenotice hidden">
            <form class="layui-form mmxgBlock" action="{:url('portal/personal/change_pass')}" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">旧密码:</label>
                    <div class="layui-input-block">
                        <input type="text" name="old_pass" required  lay-verify="required" placeholder="请输入旧密码" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">新密码:</label>
                    <div class="layui-input-block">
                        <input type="text" name="new_pass" required  lay-verify="required" placeholder="请输入新密码" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">确定新密码:</label>
                    <div class="layui-input-block">
                        <input type="text" name="sure_pass" required  lay-verify="required" placeholder="请输入再次输入新密码" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item xgmaBlock">
                    <div class="layui-input-block">
                        <button class="layui-btn maxgBtn qdxg btn btn-primary" >确定修改</button>
                        <!--<button class="layui-btn maxgBtn" lay-submit lay-filter="formDemo">取消修改</button>-->
                    </div>
                    <div style="clear: both;"></div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<script src="__STATIC__/js/jquery.min.js"></script>
<script src="__STATIC__/js/swiper.min.js"></script>
<script type="text/javascript" src="/html/js/TweenMax.min.js"></script>
<script type="text/javascript" src="/html/layui/layui.js"></script>
<script type="text/javascript" src="/html/js/base.js"></script>

<script>

    var bootstrapDateTimeInput = $("#datetime");
    if (bootstrapDateTimeInput.length) {
        Wind.css('bootstrapDatetimePicker');
        Wind.use('bootstrapDatetimePicker', function () {
            bootstrapDateTimeInput.datetimepicker({
                minView: "month", //选择日期后，不会再跳转去选择时分秒
                language:  'zh-CN',
                format: 'yyyy-mm-dd',
                todayBtn:  1,
                autoclose: 1,
            });
        });
    }
    layui.use('upload', function(){
        var upload = layui.upload;

        //上传头像
        var uploadInst = upload.render({
            elem: '#test1' //绑定元素
            ,url: '/portal/index/up_picture' //上传接口
            ,done: function(res){
                console.log(res.url);
                $("#img").val(res.url);
                $('#pic').attr('src',res.url);
                //上传完毕回调
            }
            ,error: function(){
                //请求异常回调
            }
        });
        //上传正面
        var uploadInst = upload.render({
            elem: '#imga' //绑定元素
            ,url: '/portal/index/up_picture' //上传接口
            ,done: function(res){
                console.log(res.url);
                $("#a").val(res.url);
                $('#imga').attr('src',res.url);
                $('.img_a').css('width','390px').css('height','200px').css('margin-top','0px')
                //上传完毕回调
            }
            ,error: function(){
                //请求异常回调
            }
        });
        //上传反面
        var uploadInst = upload.render({
            elem: '#imgb' //绑定元素
            ,url: '/portal/index/up_picture' //上传接口
            ,done: function(res){
                console.log(res.url);
                $("#b").val(res.url);
                $('#imgb').attr('src',res.url);
                $('.img_b').css('width','390px').css('height','200px').css('margin-top','0px')
                //上传完毕回调
            }
            ,error: function(){
                //请求异常回调
            }
        });
    });


    $(function () {
        //上面按钮点击事件
        $('#personHeight .title-item').hover(function(e){
            e.preventDefault();
            var _index = $(this).index();
            $(this).addClass('active').siblings().removeClass('active');
            $('#personHeight .box-cont .act-forenotice').eq(_index).removeClass("hidden").siblings().addClass("hidden");
            var height_con = $('#personHeight .box-cont .act-forenotice').eq(_index).height()+45;
            $(".personalRight", parent.document).height(height_con);
        });
    });
    //layui
    layui.use(['form','laydate'], function(){
        var form = layui.form
                ,laydate = layui.laydate;
        //时间选择
        laydate.render({
            elem: '#date'
        });
        //监听提交
        form.on('submit(per_data)', function(data){
            $.ajax({
                type: "post",
                url: "/portal/personal/save_user_info",
                data: data.field,
                dataType: "json",
                success: function(res) {
                    layer.msg(res.msg)
                }
            });

            });
//            layer.msg(JSON.stringify(data.field));
//            return false;

    });


</script>
</html>